﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GrayParrot.Web.Formly;

namespace FimetContoDeposito.BLL.Metadata
{
    public class ArticoliPerFornitoriMetadata
    {
        public Guid IdArticolo { get; set; }

        [FieldGroup(GroupName = "primo", Row = 1, Index = 1)]
        [FormFieldAttribute(Type = FormFieldTypes.Select)]
        [SelectTemplateOptions(Label = "Fornitore",
                               Placeholder = "Indicare il fornitore...",
                               Required = true,
                               Callback = "/api/Fornitori/LoadFornitori", ForceLoad = true)]
        public Guid IdFornitore { get; set; } 

        [FieldGroup(GroupName = "secondo", Row = 2, Index = 1, NumberOfColumns = 3)]
        [FormFieldAttribute(Type = FormFieldTypes.Number)]
        [NumericTemplateOptions(Label = "Scorta Minima", Placeholder = "Indica la scorta minima...",
            Required = false, Disabled = false, Value = 0.0)]
        public decimal? ScortaMinima { get; set; }

        [FieldGroup(GroupName = "secondo", Row = 2, Index = 2, NumberOfColumns = 3)]
        [FormFieldAttribute(Type = FormFieldTypes.Number)]
        [NumericTemplateOptions(Label = "P. Unitario", Placeholder = "Indica il prezzo unitario...",
            Required = false, Disabled = false, Value = 0.0)]
        public decimal? PrezzoUnitario { get; set; }

        [FieldGroup(GroupName = "secondo", Row = 2, Index = 3, NumberOfColumns = 3)]
        [FormFieldAttribute(Type = FormFieldTypes.Number)]
        [NumericTemplateOptions(Label = "Sconto Fornitore", Placeholder = "Indica lo sconto fornitore...",
            Required = false, Disabled = false, Value = 0.0)]
        public decimal? ScontoFornitore { get; set; }

        [FieldGroup(GroupName = "terzo", Row = 3, Index = 1)]
        [FormFieldAttribute(Type = FormFieldTypes.Textarea)]
        [TextAreaTemplateOptionsAttribute(Label = "Note",
            Description = "Lunghezza max 200 caratteri",
            Placeholder = "Indicare la descrizione",
            Required = true,
            MinLength = 0,
            MaxLength = 200, Rows=5, Cols=20)]
        public string Note { get; set; }
    }
}
